<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function fn() {
        console.log(arguments)

        //1.Array.from 可以直接将伪数组转为真数组
        // console.log(Array.from(arguments))

        //2.展开运算符
        console.log([...arguments])

        //3.for循环遍历，将伪数组的每一项给真数组
        const arr = []

        for (let i = 0; i < arguments.length; i++) {
          arr[i] = arguments[i]
        }

        console.log(arr)
      }

      fn(1, 2, 3, 4)
    </script>
  </body>
</html>
